<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div id="logoArea" class="navbar">
    <div class="navbar">
        <img src="../static/zc.png" height="600" width="100%" alt="">
    </div>
</div>
<form class="form-horizontal" role="form">
    <div class="form-group">
        <label for="loginName" class="col-sm-2 control-label">用户名</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="loginName" name="loginName"
                   placeholder="请输入用户名">
        </div>
    </div>
    <div class="form-group">
        <label for="loginPwd" class="col-sm-2 control-label">密码</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="loginPwd" name="loginPwd"
                   placeholder="请输入密码">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" onclick="add()">注册</button>
        </div>
    </div>
</form>
</body>
</html>
<script>
 function add() {
    $.post(
        "/user/insertUser",
        $("form").serialize(),
        function (obj) {
            location="/user/a";
            alert("注册成功");
        }
    )
 }
</script>
